package com.lintf.web.controller.bot;

import com.lintf.bot.domain.dto.BotNoticeListDTO;
import com.lintf.bot.domain.dto.BotNoticeUpdateDTO;
import com.lintf.bot.service.IBotNoticeService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import com.lintf.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lin tingfeng
 * @system Mac
 * @data 2024/3/21 17:09
 * @package_name com.lintf.web.controller.bot
 * @project_name mobile-project
 * @desc
 */
@RequestMapping("/bot/notice")
@RestController
public class BotNoticeController extends BaseController {

    @Autowired
    private IBotNoticeService botNoticeService;

    @GetMapping("/list")
    public TableDataInfo list(BotNoticeListDTO dto) {
        startPage();
        return getDataTable(botNoticeService.list(dto));
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotNoticeUpdateDTO dto) {
        botNoticeService.update(dto);
        return AjaxResult.success();
    }

    @PostMapping("/remove")
    public AjaxResult remove(@RequestBody BotNoticeUpdateDTO dto) {
        botNoticeService.remove(dto);
        return AjaxResult.success();
    }

}
